package org.thinker.dao;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.thinker.point.PointVO;

public class DAOTest {

	private DAO dao;

	@Before
	public void doA() throws Exception {
		dao = DAO.inst;
	}

	@Test
	public void test1() throws Exception {
		Assert.assertNotNull(dao);

		for (int i = 0; i < 100; i++) {

			PointVO testObj = new PointVO("b" + i, 123231D, 45345345D);

			dao.add(testObj);

		}
	}

	@Test
	public void testRead() throws Exception {
		Assert.assertNotNull(dao);

		PointVO result = dao.get("b86");

		Assert.assertNotNull(result);
		System.out.println("-------------");
		System.out.println(result);

	}

	@Test
	public void testDelete() throws Exception {
		Assert.assertNotNull(dao);

		dao.remove("b10");
	}
}